package com.dgty.dg_common.widget.rv.adapter

import com.contrarywind.adapter.WheelAdapter
import com.dgty.dg_common.util.Extension.toEnglishMonth

/**
 * Title: EnglishWheelAdapter$
 * Description:
 *
 * Created DateTime: 2023/2/15$ 17:47$
 * Created by cacif$.
 */
class EnglishWheelAdapter(minValue: Int, maxValue: Int) : WheelAdapter<String> {

    var minValue = 0
    var maxValue = 0

    init {
        this.minValue = minValue
        this.maxValue = maxValue
    }

    override fun getItem(index: Int): String? {
        return if (index >= 0 && index < getItemsCount()) {
            (minValue + index).toEnglishMonth()
        } else ""
    }

    override fun getItemsCount(): Int {
        return maxValue - minValue + 1
    }

    override fun indexOf(o: String?): Int {
        return 0
    }

}